package cn.glfs.domain.strategy.service.rule.tree.factory;

import cn.glfs.domain.strategy.model.valobj.RuleTreeVO;
import cn.glfs.domain.strategy.service.rule.tree.ILogicTreeNode;
import cn.glfs.domain.strategy.service.rule.tree.factory.engine.IDecisionTreeEngine;
import cn.glfs.domain.strategy.service.rule.tree.factory.engine.impl.DecisionTreeEngine;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class DefaultTreeFactory {

    private final Map<String, ILogicTreeNode> logicTreeNodeGroup;

    public DefaultTreeFactory(Map<String, ILogicTreeNode> logicTreeNodeGroup) {
        this.logicTreeNodeGroup = logicTreeNodeGroup;
    }


    public IDecisionTreeEngine openLogicTree(RuleTreeVO ruleTreeVO) {
        return new DecisionTreeEngine(logicTreeNodeGroup, ruleTreeVO);
    }

}
